#include <stdio.h>

#define NMAX 7000

/*
void
Insertion_sort(int* a, int n)
{
	register int i, k, tmp;

	for (i = 1 ; i < n ; ++i) {
		for (k = i ; a[k] < a[k-1] && k>0 ; --k) {
			tmp = a[k]; *//* fix this *//*
			a[k] = a[k-1];
			a[k-1] = tmp;
		}
	}
}*/



void
Insertion_sort(int* a, int n)
{
	register int i, k, tmp;

	for (i = 1 ; i < n ; ++i) {
		k = i;
		tmp = a[i];
		while (tmp < a[k-1] && k > 0) {
			a[k] = a[k-1];
			--k;
		}
		a[k] = tmp;
	}
}



int
main(void)
{
	int array[NMAX], n, i=0;

	freopen("insertion.in", "rt", stdin);
	freopen("insertion.out", "w", stdout);

	scanf("%d\n", &n);
	while(i<n)
		(void)scanf("%d", &array[i++]);

	Insertion_sort(&array[0], n);

	i = 0;
	while (i<n)
		(void)printf("%d ", array[i++]);
	putchar('\n');
	return 0;
}
